import { ApiProperty } from "@midwayjs/swagger";
import { BaseEntity } from "../../util";
import { SortType, UserType } from "../class";
import { objType } from "../indexD";

export class BaseDTO {
    @ApiProperty()
    appId: string;
    @ApiProperty()
    appToken: string;
}

export class InsertAPPDTO extends BaseDTO {
    @ApiProperty()
    appSecret: string;
}

export class WikiNodeDTO extends BaseDTO {
    @ApiProperty()
    type: objType;
}

export class DocsDataDTO {
    @ApiProperty()
    appToken: string;
    @ApiProperty()
    tableId: string;
    @ApiProperty()
    data: any;
    @ApiProperty()
    recordId: string;
    @ApiProperty()
    appId?: string
}

export class AllQunChatsDTO {
    @ApiProperty({
        enum: UserType,
        default: UserType.user_id
    })
    userType?: UserType;
    @ApiProperty({
        enum: SortType,
        default: SortType.ByCreateTimeAsc
    })
    sortType?: SortType;
    @ApiProperty()
    pageSize?: number;
    @ApiProperty()
    appId?: string
}

export class OperLogDTO extends BaseEntity {
    @ApiProperty()
    operId: number
}

export class AppConfigDTO extends BaseEntity {
    @ApiProperty()
    id: number
    @ApiProperty()
    appId: string;
    @ApiProperty()
    appSecret?: string;
    @ApiProperty()
    appStatus: number
}

export class AppLogDTO extends BaseEntity {
    @ApiProperty()
    id: number
}

export class MessageLogDTO extends BaseEntity {
    @ApiProperty()
    id: number
}

export class DocsDataBaseDTO extends BaseEntity {
    @ApiProperty()
    id: number

    @ApiProperty()
    ids: string

    @ApiProperty()
    reschedule: boolean

    @ApiProperty()
    cronExpresson: string
}

export class SqlModelDTO {
    @ApiProperty()
    database: string
    @ApiProperty()
    query: string
}